package com.nisco.dms.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import com.nisco.dms.entity.Dictionary;
import com.nisco.dms.repository.DictionaryDao;
import com.nisco.dms.util.dwz.Page;
import com.nisco.dms.util.dwz.PageUtils;
@Service
public class DictionaryService extends BaseService<Dictionary, String>
{
	@Resource
	private DictionaryDao dictionaryDao;
	

	public DictionaryService()
	{
	}

	@Autowired
	public DictionaryService(DictionaryDao dictionaryDao)
	{
		super((JpaRepository<Dictionary, String>)dictionaryDao);
		this.dictionaryDao = dictionaryDao;
	}
	
	public List<Dictionary> findDictBykeywords(Page page,String keywords)
	{
		org.springframework.data.domain.Page<Dictionary> pageDict=dictionaryDao.findByStrSnContainingOrStrNameContainingOrStrDescContaining(PageUtils.createPageable(page), keywords, keywords, keywords);
		return pageDict.getContent();
	}
	

}
